package com.google.shop.product.service.impl.product;

import com.google.shop.product.entity.product.ProductCategory;
import com.google.shop.product.entity.product.ProductSpu;
import com.google.shop.product.repository.product.ProductCategoryRepository;
import com.google.shop.product.repository.product.ProductSpuRepository;
import com.google.shop.product.service.product.ProductSpuService;
import com.google.shop.product.vo.ProductSpuCategoryVO;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
/* loaded from: app.jar:BOOT-INF/classes/com/google/shop/product/service/impl/product/ProductSpuImpl.class */
public class ProductSpuImpl implements ProductSpuService {
    @Autowired
    private ProductSpuRepository productSpuRepository;
    @Autowired
    private ProductCategoryRepository productCategoryRepository;

    @Override // com.google.shop.product.service.product.ProductSpuService
    public ProductSpuCategoryVO findHomeVO() {
        ProductSpuCategoryVO spuCategoryVO = new ProductSpuCategoryVO();
        List<ProductSpu> spuList = this.productSpuRepository.findByCategoryId(1);
        List<ProductCategory> categoryList = this.productCategoryRepository.findAll();
        spuCategoryVO.setProductSpu(spuList);
        spuCategoryVO.setProductCategory(categoryList);
        return spuCategoryVO;
    }

    @Override // com.google.shop.product.service.product.ProductSpuService
    public List<ProductSpu> findProductListByCategoryId(Integer categoryId) {
        return this.productSpuRepository.findByCategoryId(categoryId);
    }
}
